Skip to content

Remove dead code: unused macros and unreachable breaks#189

Draft
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/remove-dead-code
Draft

Remove dead code: unused macros and unreachable breaks#189
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/remove-dead-code

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

What

Remove unused preprocessor macros and unreachable break statements.

Why

KEY_KEY, PADDING_KEY, and HASH_KEY are relics from an older design where RSA data was stored in a Perl hash. The current code uses a C struct (rsaData) and none of these macros are referenced. PACKAGE_NAME is retained — the XS typemap uses it for type checking.

The break statements after return in get_digest_length() are dead code (unreachable after return).

How

  • Delete three unused #define macros and their comment block
  • Remove nine unreachable break statements in get_digest_length()

Testing

  • Clean build on OpenSSL 3.5.1 — no warnings
  • Full test suite passes (26 test files)

🤖 Generated with Claude Code

- Remove KEY_KEY, PADDING_KEY, HASH_KEY macros — vestiges of an older
  design that stored RSA data in a Perl hash instead of the current C
  struct. No code references them.
- Remove unreachable break statements after return in
  get_digest_length() — each case returns directly, making the
  subsequent break dead code.

PACKAGE_NAME is retained: the XS typemap references it for blessed
reference type checking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant